<template>
    <view style="padding: 10px;">
        <view>plugin测试界面</view>
        <u-button class="action" type="primary" text="PluginTestFunction" @click="PluginTestFunction"></u-button>
        <u-button class="action" type="primary" text="pluginShowArrayArgu" @click="pluginShowArrayArgu"></u-button>
        <u-button class="action" type="primary" text="PluginTestFunctionSync"
                  @click="PluginTestFunctionSync"></u-button>
        <u-button class="action" type="primary" text="pluginGetStringArrayArgu"
                  @click="pluginGetStringArrayArgu"></u-button>
    </view>
</template>

<script>
let plugins = require('./plugins.js')
export default {
  data() {
    return {
      plugins: plugins
    }
  },
  methods: {
    PluginTestFunction() {
      this.plugins.PluginTestFunction("Html5", "Plus", "AsyncFunction", "MultiArgument!", function (result) {
        console.log(result[0] + "_" + result[1] + "_" + result[2] + "_" + result[3]);
      }, function (result) {
        console.log(result)
      });
    },
    pluginShowArrayArgu() {
      plus.plugintest.PluginTestFunctionArrayArgu(["Html5", "Plus", "AsyncFunction", "ArrayArgument!"], function (
          result) {
        alert(result);
      }, function (result) {
        alert(result)
      });
    },
    pluginGetString() {
      alert(plus.plugintest.PluginTestFunctionSync("Html5", "Plus", "SyncFunction", "MultiArgument!"));
    },
    pluginGetStringArrayArgu() {
      var Argus = plus.plugintest.PluginTestFunctionSyncArrayArgu(["Html5", "Plus", "SyncFunction",
        "ArrayArgument!"
      ]);
      alert(Argus.RetArgu1 + "_" + Argus.RetArgu2 + "_" + Argus.RetArgu3 + "_" + Argus.RetArgu4);
    }
  }
}
</script>

<style>
    .action {
        margin-top: 5px;
    }
</style>
